﻿// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include "../test/common/print_plugin.h"
#include <stdio.h>

#define FUNCTION_ID 2

class CPrintFunction2 : public IPrintPlugin
{
public:
    void Initial()
    {
    };
    void UnInitial()
    {
    }
    void Destory()
    {
        delete this;
    }
    void Start()
    {
    };
    void Stop()
    {
    };
    long GetID()
    {
        return FUNCTION_ID;
    };
    virtual void Print()
    {
        printf("hello China\n");
    };
    virtual void Help()
    {
        printf("print_function1 ID=%d, print hello China\n", GetID());
    };
};


extern "C" __declspec(dllexport) void* create_obj()
{
    CPrintFunction2* ptr = new CPrintFunction2;
    return ptr;
}


BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

